#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int a[2000] = { 0 }, i, j;
	for (i = 2; i <= 1000; i++)
	{
		a[i] = 0;
		for (j = 1; j < i; j++) {
			if (i % j == 0) a[i] = a[i] + j;
		}
	}
	int k, t, n, s;
	scanf("%d", &t);
	for (k = 0; k < t; k++)
	{
		scanf("%d", &n);
		s = 0;
		for (i = 2; i <= 1000; i++) {
			if (a[i] == n)
			{
				s = 1;
				break;
			}
		}
		if (s == 1) printf("no\n");
		else printf("yes\n");
	}


	return 0;
}
//1135